package kr.ac.kaist.savehearts;

public class SaveHeartsConstants {
	public static int SPLASH_DELAY = 1000;	// 3 seconds
	
	/**
	 * URL of the server which updates location of nearby users
	 */
//	public static final String SERVER_URL = "http://www.savehearts.or.kr";
	public static final String SERVER_URL = "http://funface2.kaist.ac.kr/ss2011/";
	
	/**
	 * APP ID required for authentication using facebook account (SSO)
	 */
	public static final String FACEBOOK_APP_ID = "163344363790057";
	
	/**
	 * AppSecret which is generated in developers' page in Facebook
	 */
	public static final String FACEBOOK_APP_SECRET = "19aaa08a5680a17c9b27d7e327151b7d";
	
	/**
	 * Map API key for the usage of google mapview
	 */
	public static final String GOOGLE_MAP_API_KEY = "01YHud-9I9fY08qTUpwLE6bb6hztKmrX_b45r3A";
	
	/**
	 * Regular expression for e-mail address validation
	 */
	public static final String EMAIL_PATTERN = "\\w+@\\w+\\.\\w+";
	
	/**
	 * Request code for image picker (from gallery)
	 */
	public static final int IMAGE_PICK_REQUEST_CODE = 12345;

	/**
	 * Default image for user image for sign-up
	 */
	public static final int USER_PICTURE_DEFAULT = android.R.drawable.ic_menu_gallery;
	
	/**
	 * Default location of MapView (KAIST, Daejeon)
	 */
	public static final double DEFAULT_LATITUDE = 36.370226;
	public static final double DEFAULT_LONGITUDE = 127.360640;
	
	/**
	 * Default zoom level of MapView
	 */
	public static final int DEFAULT_ZOOM_LEVEL = 17;
	
	/**
	 * Tab names in MainActivity (Rescue, AED, and Settings)
	 */
	public static final String TAB_RESCUE = "tabRescue";
	public static final String TAB_AED = "tabAED";
	public static final String TAB_SETTINGS = "tagSettings";
	
	/**
	 * 1 Minute = 60 * 1000 Milliseconds
	 */
	public static final int MIN_IN_MS = 60 * 1000;
	
	/**
	 * Default GPS update interval in minutes
	 */
	public static final int DEFAULT_GPS_INTERVAL_MIN = 15;
	
	/**
	 * Default GPS update interval in milliseconds 
	 */
	public static final int DEFAULT_GPS_INTERVAL = DEFAULT_GPS_INTERVAL_MIN * MIN_IN_MS;
	
	/**
	 * Invalid GPS update interval (-1)
	 */
	public static final int GPS_INVALID = -1;
	
	/**
	 * Default interval in minutes for status update (report current location & get nearby users)
	 */
	public static final int DEFAULT_STATUS_UPDATE_INTERVAL_MIN = 1;
	
	/**
	 * Default interval in milliseconds for status update (report current location & get nearby users)
	 */
	public static final int DEFAULT_STATUS_UPDATE_INTERVAL = DEFAULT_STATUS_UPDATE_INTERVAL_MIN * MIN_IN_MS;
	
	/**
	 * Minimum/maximum interval of GPS updates (in minutes)
	 */
	public static final int GPS_MIN_INTERVAL = 1;
	public static final int GPS_MAX_INTERVAL = 60;
	
	public static final String PREFERENCE = "SaveHeartsPref";
	
	/**
	 * Property names used for SharedPreference, HTTP post request/response
	 */
	public static final String PROP_GPS_ON = "gpsstatus";
	public static final String PROP_GPS_INTERVAL = "gpsinterval";
	public static final String PROP_LASTNAME = "lastname";
	public static final String PROP_FIRSTNAME = "firstname";
	public static final String PROP_FULLNAMT = "fullname";
	public static final String PROP_ID = "id";
	public static final String PROP_EMAIL = "email";
	public static final String PROP_PASSWORD = "passwd";
	public static final String PROP_PICTURE_URL = "pictureurl";
	public static final String PROP_STATUS_UPDATE_INTERVAL = "statusinterval";
	public static final String PROP_LONGITUDE = "longitude";
	public static final String PROP_LATITUDE = "latitude";
	public static final String PROP_USERS = "users";
	public static final String PROP_TIMESTAMP = "timestamp";
	public static final String PROP_PHONENUMBER = "phone";
	
	public static final String PROP_MSG_TYPE = "type";
	public static final String PROP_TYPE_EMERGENCY = "emergency";
	public static final String PROP_TYPE_REPORT = "report";
	
	/**
	 * Type of responses for the request to the server
	 */
	public static final int STATUS_OK = 0;
	public static final int STATUS_INVALID_EMAIL = 1;
	public static final int STATUS_INVALID_PASSWORD = 2;
	public static final int STATUS_NULL_PARAMTER = 3;
	public static final int STATUS_FAIL_UNKNOWN = 5;
	
	/**
	 * Last parts (path) of server URL providing functions 
	 * (join, login, modify, delete, update, and get neighbors) 
	 */
	public static final String URL_JOIN = "user_join.php";
	public static final String URL_LOGIN = "user_login.php";
	public static final String URL_MODIFY = "user_modify.php";
	public static final String URL_DELETE = "user_delete.php";
	public static final String URL_LOCATION_UPDATE = "location_update.php";
	public static final String URL_NEIGHBORS = "location_pher_listing.php";
}
